package com.aoyama.juc.thread;

/**
 * @author ：qs
 * @date ：Created in 2022/5/29
 * @description：
 * @modified By：
 */
public class ThreadCloseForce {

    public static void main(String[] args) {

        ThreadService service = new ThreadService();
        long start = System.currentTimeMillis();
        service.execute(() -> {
            //load a very heavy resource. 模拟任务超时
            /*while (true) {

            }*/
            try {
                Thread.sleep(50000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });
        service.shutdown(10000);
        long end = System.currentTimeMillis();
        System.out.println(end - start);
    }
}
